package com.maixy.studyonlineapi.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName ActivityViewType
 * @Description TODO
 * @Date 2021/1/10 20:05
 * @Author maixy
 */
@AllArgsConstructor
@Getter
public enum ActivityViewTypeEnum {
    TEACHER(1, "teacher","教师"),
    STUDENT(2, "student","学生"),
    DETAIL(3, "detail", "详情"),
    HOT(4,"hot","热门课程"),
    NEW(5,"new","新上好课"),
    DISCOVER(6,"discover","全局查找");
    private final Integer id;
    private final String code;
    private final String desc;

    public static ActivityViewTypeEnum getById(Integer id) {
        for (ActivityViewTypeEnum typeEnum : values()) {
            if (typeEnum.getId().equals(id)) {
                return typeEnum;
            }
        }
        return TEACHER;
    }
}
